!!!
%html
  %body
    .span15
      .container
        .col-md-12
          .row
            .page-header
              %h1
                Tasks
            .row
              .col-md-10.pull-left
                Task are predefined hashcat commands. Any number of tasks can be assigned to a Job.
              .col-md-2.pull-right
                %a.btn.btn-primary.pull-right{href: '/tasks/create'}
                  Create Task
      %br
      %br
      .container
        .row
          .col-md-12
            .table
              %table{class: 'table table-striped'}
                %thead
                  %tr
                    %th
                      %b Task Name
                    %th
                      %b Type
                    %th
                      %b Controls
                %tbody
                  - if @tasks
                    - @tasks.each do |task|
                      %tr
                        %td #{task.name}
                        %td #{task.hc_attackmode}
                        %td
                          %a.btn.btn-info{href: "#modal#{task.id}", 'data-toggle' => 'modal'}
                            %i.glyphicon.glyphicon-info-sign{title: 'Info'}
                          .modal.fade.modal{id: "modal#{task.id}", role: 'dialog', tabindex: '-1', 'aria-hidden' => 'true'}
                            .modal-dialog.modal-lg
                              .modal-content
                                .modal-header
                                  %button.close{'aria-label' => 'Close', 'data-dismiss' => 'modal', type: 'button'}
                                    %span{'aria-hidden' => 'true'} &times;
                                  %h4.modal-title Task details for: #{task.name}
                                .modal-body
                                  .row
                                    .form-group
                                      %label.control-label.col-xs-2{for: ''} Task Name
                                      .col-xs-10
                                        #{task.name}
                                  .row
                                    .form-group
                                      %label.control-label.col-xs-2{for: ''} Attack Mode
                                      .col-xs-4
                                        #{task.hc_attackmode}
                                  - if task.hc_attackmode == 'dictionary'
                                    .row
                                      .form-group
                                        %label.control-label.col-xs-2{for: ''} Wordlist
                                        .col-xs-4
                                          - @wordlists.each do |wl|
                                            - if wl.id.to_i == task.wl_id.to_i
                                              #{wl.name}
                                    -if task.hc_rule != 'none'
                                      .row
                                        .form-group
                                          %label.control-label.col-xs-2{for: ''} Dictionary Rule
                                          .col-xs-4
                                            - @rules.each do |rule|
                                              - if rule.id.to_i == task.hc_rule.to_i
                                                #{rule.name} (cnt: #{rule.size})
                                  .row
                                    .form-group
                                      %label.control-label.col-xs-2{for: ''} Keyspace
                                      .col-xs-4
                                        - if task.keyspace.nil?
                                          Task will not be chunked
                                        - else
                                          #{task.keyspace}
                          %a.btn.btn-warning{href: "/tasks/edit/#{task.id}"}
                            %i.glyphicon.glyphicon-cog{title: 'Edit'}
                          %a.btn.btn-danger{href: "/tasks/delete/#{task.id}"}
                            %i.glyphicon.glyphicon-trash{title: 'Delete'}
